package com.etone.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.etone.common.annotation.Log;
import com.etone.common.core.controller.BaseController;
import com.etone.common.core.domain.AjaxResult;
import com.etone.common.enums.BusinessType;
import com.etone.system.domain.FiveTaskinfo;
import com.etone.system.service.IFiveTaskinfoService;
import com.etone.common.utils.poi.ExcelUtil;
import com.etone.common.core.page.TableDataInfo;

/**
 * 潜伏车运行日志记录Controller
 *
 * @author etone
 * @date 2025-05-26
 */
@RestController
@RequestMapping("/system/taskinfo")
public class FiveTaskinfoController extends BaseController
{
    @Autowired
    private IFiveTaskinfoService fiveTaskinfoService;

    /**
     * 查询潜伏车运行日志记录列表
     */
    @PreAuthorize("@ss.hasPermi('system:taskinfo:list')")
    @GetMapping("/list")
    public TableDataInfo list(FiveTaskinfo fiveTaskinfo)
    {
        startPage();
        List<FiveTaskinfo> list = fiveTaskinfoService.selectFiveTaskinfoList(fiveTaskinfo);
        return getDataTable(list);
    }

    /**
     * 导出潜伏车运行日志记录列表
     */
    @PreAuthorize("@ss.hasPermi('system:taskinfo:export')")
    @Log(title = "潜伏车运行日志记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, FiveTaskinfo fiveTaskinfo)
    {
        List<FiveTaskinfo> list = fiveTaskinfoService.selectFiveTaskinfoList(fiveTaskinfo);
        ExcelUtil<FiveTaskinfo> util = new ExcelUtil<FiveTaskinfo>(FiveTaskinfo.class);
        util.exportExcel(response, list, "潜伏车运行日志记录数据");
    }

    /**
     * 获取潜伏车运行日志记录详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:taskinfo:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(fiveTaskinfoService.selectFiveTaskinfoById(id));
    }

    /**
     * 新增潜伏车运行日志记录
     */
    @PreAuthorize("@ss.hasPermi('system:taskinfo:add')")
    @Log(title = "潜伏车运行日志记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody FiveTaskinfo fiveTaskinfo)
    {
        return toAjax(fiveTaskinfoService.insertFiveTaskinfo(fiveTaskinfo));
    }

    /**
     * 修改潜伏车运行日志记录
     */
    @PreAuthorize("@ss.hasPermi('system:taskinfo:edit')")
    @Log(title = "潜伏车运行日志记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody FiveTaskinfo fiveTaskinfo)
    {
        return toAjax(fiveTaskinfoService.updateFiveTaskinfo(fiveTaskinfo));
    }

    /**
     * 删除潜伏车运行日志记录
     */
    @PreAuthorize("@ss.hasPermi('system:taskinfo:remove')")
    @Log(title = "潜伏车运行日志记录", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(fiveTaskinfoService.deleteFiveTaskinfoByIds(ids));
    }
}
